package socrates.mobile;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import java.util.ArrayList;
import java.util.List;
import socrates.dto.ClaseDTO;
import socrates.dto.HorarioDTO;
import socrates.ws.WSHorario;

public class AsA2 extends ListActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.notacursos);

		ArrayList<String> HORA = new ArrayList<String>();

		List<HorarioDTO> h =
						(new WSHorario("http://www.upcferiaexpoti2011.com/SocratesMobile/Service.svc/Horario/",
						1,
						"20111010",
						"20111016")).obtener_horario();

		int g = getIntent().getExtras().getInt("d");

		for (HorarioDTO a : h) {
			if (a.getCodigo_dia() == g) {
				List<ClaseDTO> c = a.getObjClase();
				for (ClaseDTO e : c) {

					HORA.add(e.CursoNombre + " (" + e.getHora_Inicio() +")");

				}
			}
		}

		setListAdapter(new ArrayAdapter<String>(this, R.layout.notacurso,
						HORA));

		registerForContextMenu(getListView());
	}
}